---
title: "Balancing algorithm report"
output:
  html_document:
    df_print: paged
editor_options:
  chunk_output_type: console
---

```{r,message=FALSE,echo=FALSE}
library(dplyr)
```

```{r,echo=FALSE}
# Supply a "MyData.csv" to the directory,
# where column 1 of csv is the ID
clean <- read.csv("~/Misc/bjpolFinal/France/france_clean.csv")
MyData=clean
MyData=select(MyData,Record.ID,joint,pol,sex,vot)
write.csv(MyData,"MyData.csv",row.names = F)
MyData <- read.csv("MyData.csv")
```

# Python (config = code) 
```{python engine.path="/usr/bin/python3.5",results='hide'}
import sys
sys.path.append('/home/shared/data/balancing/')
import inject_v2
config = "{1: {'degreeHigh':9.0,'noDegreeHigh':39.9,'degreeLow':21.5,'noDegreeLow':29.6}},{2: {'interest':56.5,'LowInterest':43.5}},{3: {'Male':48.4,'Female':51.6}},{4: {'FN':22.33,'UMP':18.68,'PS':12.56,'MoDem':8.93,'EE':8.04,'FG':5.93,'DLR':3.53,'Undec':20.00}}"

filename = '/home/fernando/Misc/bjpolFinal/France/MyData.csv'

inject_v2.run(config, filename, "/home/fernando/Misc/bjpolFinal/France/myBal", 2, 0, 0)
```
